package models

import "gorm.io/gorm"

type Docter struct {
	gorm.Model
	Img   string  `gorm:"type:varchar(100);not null;comment:患者头像" json:"img"`
	Name  string  `gorm:"type:varchar(30);not null;comment:患者姓名" json:"name"`
	Tel   string  `gorm:"type:char(11);comment:患者手机号" json:"tel"`
	Types string  `gorm:"type:varchar(30);not null;comment:病情分类" json:"types"`
	Price float64 `gorm:"type:decimal(10,2);not null;comment:挂号费" json:"price"`
}

func (d *Docter) Create() error {
	return DB.Create(&d).Error
}
func (d *Docter) List() (docters []*Docter, err error) {
	err = DB.Find(&docters).Error
	return
}
